feat(wasm-utxo): implement signing workflow#68
Merged
OttoAllmendinger merged 4 commits intomasterfrom Nov 27, 2025
Merged
Conversation
- Add FirstRound HashMap storage to WASM BitGoPsbt struct - Add generate_musig2_nonces WASM method with security checks - Add generateMusig2Nonces() TypeScript method - Add to_xpriv() method to WasmBIP32 for internal use - Create walletKeys.util.ts test helper - Create musig2Nonces.ts test file with comprehensive test cases - Security: Custom session IDs only allowed on testnets Issue: BTC-2786
Add sign methods to BitGoPsbt to support signing individual inputs by index: - Implement `sign` in JS that dispatches based on key type - Add Rust `sign_with_xpriv` method for wallet inputs (BIP32) - Add Rust `sign_with_privkey` method for raw private keys (ECPair) - Handle MuSig2 inputs with existing first round state - Support replay protection inputs with proper P2SH sighashing - Add comprehensive tests and documentation Issue: BTC-2786 Co-authored-by: llm-git <llm-git@ttll.de>
Implements new combineMusig2Nonces method to merge MuSig2 nonces from different PSBTs. This enables proper nonce exchange between cosigners during the MuSig2 signing workflow. The method copies nonces and partial signatures between PSBTs, validates network compatibility, and handles input count matching. Includes comprehensive tests and updated documentation with examples showing the complete MuSig2 signing workflow. Issue: BTC-2786 Co-authored-by: llm-git <llm-git@ttll.de>
64e10e1 to
322a745
Compare
Add clippy::boxed_local allow annotations for methods that use Box<[T]> parameters, which are required by wasm-bindgen for passing JavaScript arrays. Issue: BTC-2786 Co-authored-by: llm-git <llm-git@ttll.de>
lcovar
approved these changes
Nov 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds complete signing support to the WASM-UTXO library with
three key components:
MuSig2 Nonce Generation
MuSig2 Nonce Combination
Single Input Signing
The implementation includes comprehensive tests, documentation, and examples
showing the complete MuSig2 signing workflow.
Issue: BTC-2786